﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace BDS3M.Admin.Controls
{
    public partial class ViewRecruitment : System.Web.UI.UserControl
    {
        public string tieude;
        public string title;
        public string summary;
        public string description;
        public string date;
        public int id;
        protected void Page_Load(object sender, EventArgs e)
        {
            
                if (Request.QueryString["id"] != null)
                {
                    id = Convert.ToInt32(Request.QueryString["id"]);
                    DataTable dt = DAL.DCollector.DBCollector.Instance.StoredSelectAllTableWhereID("tbl_TuyenDung", "TuyenDung_ID", id.ToString());
                    tieude = dt.Rows[0]["TuyenDung_TieuDe"].ToString();
                    title = dt.Rows[0]["TuyenDung_Title"].ToString();
                    summary = dt.Rows[0]["TuyenDung_Summary"].ToString();
                    description = dt.Rows[0]["TuyenDung_Description"].ToString();
                    date = dt.Rows[0]["TuyenDung_Date"].ToString();
                    txtTieuDe.Text = tieude;
                    txtTitle.Text = title;
                    txtSummary.Text = summary;
                    txtDescription.Text = description;
                    txtDate.Text = date;
                }
            
        }

        protected void lbtDelete_Click(object sender, EventArgs e)
        {
            id = Convert.ToInt32(Request.QueryString["id"]);
            DAL.DCollector.DBCollector.Instance.StoredProcedureDeleteByRows("tbl_TuyenDung", "TuyenDung_ID", id.ToString());
            Response.Redirect("/Admin/Index.aspx?panel=3&sub=16");
        }
    }
}